package cn.lg.soar.boot.fc.entity;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.translate.TranslateByEntity;
import cn.lg.soar.system.auth.entity.Org;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 校区表
 * @author lhp
 * @since 2024-12-25
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ExcelIgnoreUnannotated
@Getter
@Setter
@Accessors(chain = true)
@ApiModel(value = "Campus", description = "校区表")
@TableName("fc_campus")
public class Campus extends BaseEntity {

    /**  */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 校区名称 */
    @NotBlank(message = "校区名称不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "校区名称")
    @ApiModelProperty(value = "校区名称")
    private String name;

    /** 校区地址 */
    @NotBlank(message = "校区地址不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "校区地址")
    @ApiModelProperty(value = "校区地址")
    private String address;

    /** 校区面积 */
    @NotBlank(message = "校区面积不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "校区面积")
    @ApiModelProperty(value = "校区面积")
    private String area;

    /** 校区图片 */
    @ApiModelProperty(value = "校区图片")
    private String img;

    /** 楼栋数量 */
    @ExcelProperty(value = "楼栋数量")
    @ApiModelProperty(value = "楼栋数量")
    private Integer buildingNum;

    /** 楼栋面积 */
    @ExcelProperty(value = "楼栋面积")
    @ApiModelProperty(value = "楼栋面积")
    private String buildingArea;

    /** 房间数量 */
    @ExcelProperty(value = "房间数量")
    @ApiModelProperty(value = "房间数量")
    private Integer roomNum;

    /** 房间面积 */
    @ExcelProperty(value = "房间面积")
    @ApiModelProperty(value = "房间面积")
    private String roomArea;

    /** 附件 */
    @ApiModelProperty(value = "附件")
    private String attachment;

    /** 排序 */
//    @NotNull(message = "排序不能为空", groups = { Create.class, Update.class })
    @ApiModelProperty(value = "排序")
    private Integer orders;

    /** 楼栋面积 */
    @ExcelProperty(value = "校区地图位置json")
    @ApiModelProperty(value = "校区地图位置json")
    private String mapJson;

    /** 乐观锁 */
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    /** 扩展字段1 */
    @ApiModelProperty(value = "扩展字段1")
    private String extend1;

    /** 扩展字段2 */
    @ApiModelProperty(value = "扩展字段2")
    private String extend2;

    /** 扩展字段3 */
    @ApiModelProperty(value = "扩展字段3")
    private String extend3;

    @ApiModelProperty(value = "节点id")
    private String parentId;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
